<html xmlns:th="http://www.thymeleaf.org">
<meta charset="UTF-8">
<!-- js+css -->
<div th:fragment="source">
    <link th:href="@{/AmazeUI-2.4.2/assets/css/admin.css}" rel="stylesheet" type="text/css">
    <link th:href="@{/AmazeUI-2.4.2/assets/css/amazeui.css}" rel="stylesheet" type="text/css">

    <link th:href="@{/css/personal.css}" rel="stylesheet" type="text/css">
    <link th:href="@{/css/stepstyle.css}" rel="stylesheet" type="text/css">

    <script type="text/javascript" th:src="@{/js/jquery-1.7.2.min.js}"></script>
    <!--<script src="../static/AmazeUI-2.4.2/assets/js/amazeui.js"></script>-->

</div>

<div th:fragment="header">
    <script th:inline="javascript">
        var basePath = "/wood";
    </script>
    <!--头 -->
    <header>
        <article>
            <div class="mt-logo">
                <!--顶部导航条 -->
                <div class="am-container header" style="background-color: #e0efff;">
                    <ul class="message-l">
                        <div class="topMessage">
                            <div class="menu-hd">
                                <span class="fl" th:if="${session.User == null}"><a th:href="@{/login}" target="_top" class="h">亲，请登录</a>&nbsp;<a href="/register" style="color:#ff4e00;">免费注册</a>&nbsp;&nbsp;</span>
                                <span class="fl" th:if="${session.User != null}"><a th:href="@{/user/information}" >欢迎回来，<span th:text="${session.User.username}"></span></a>&nbsp;|&nbsp;<a th:href="@{/order/orderList}">我的订单</a>&nbsp;</span>
                                <span class="fl" th:if="${session.User != null}">|&nbsp;<a th:href="@{/user/logout}">注销</a></span>
                            </div>
                        </div>
                    </ul>
                    <!--<ul class="message-r">
                        <div class="topMessage home">
                            <div class="menu-hd">
                                <a href="#" target="_top" class="h">商城首页</a>
                            </div>
                        </div>
                        <div class="topMessage my-shangcheng">
                            <div class="menu-hd MyShangcheng">
                                <a th:href="@{/user/index}" target="_top">
                                    <i class="am-icon-user am-icon-fw"></i>个人中心</a>
                            </div>
                        </div>

                        <div class="topMessage favorite">
                            <div class="menu-hd"><a href="#" target="_top"><i
                                    class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a></div>
                        </div>
                    </ul>-->
                </div>

                <!--悬浮搜索框-->

                <!--<div class="nav white">
                    <div class="logoBig">
                        <li><img src="../static/images/logobig.png"/></li>
                    </div>

                    <div class="search-bar pr">
                        <a name="index_none_header_sysc" href="#">沙发</a>
                        <form th:action="@{/product/search}" method="post">
                            <input id="searchInput" name="searchInput" type="text" placeholder="搜索"
                                   autocomplete="on">
                            <input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
                        </form>
                    </div>
                </div>-->
                <div class="top">
                    <div class="logo">
                        <a href="/index"><img src=../images/居家乐.jpg style="width: 100px;"></a>
                    </div>
                    <div class="search">
                        <form th:action="@{/product/search}" method="post">
                            <input type="text" name="searchInput" class="s_ipt">
                            <input type="submit" value="搜索" class="s_btn">
                        </form>
                    </div>
                    <div class="i_car">
                        <a href="/cart/findAllCart">
                            <div class="car_t" >
                                购物车 [
                                                    <span th:text="${cartList.size()}"></span>
                                ]
                            </div>
                        </a>

                        <div class="car_bg">
                            <div class="un_login">我的购物车</div>
                            <ul class="cars">
                                                    <li th:each="cart:${cartList}">
                                                        <div class="img"><a th:href="@{'/product/findById/'+${cart.productId}}"><img th:src="'/images/'+${cart.fileName}" width="58" height="58" /></a></div>
                                                        <div class="name"><a th:href="@{'/product/findById/'+${cart.productId}}" th:text="${cart.name}"></a></div>
                                                        <div class="price"><font color="#ff4e00" th:text="'￥'+${cart.price}"></font> X <span class="quantity" th:text="${cart.quantity}"></span>  =  <span class="cost" th:text="${cart.cost}"></span></div>
                                </li>
                            </ul>
                            <div class="price_sum">共计&nbsp;<font color="#ff4e00">￥</font><span id="totalCost"></span></div>
                            <div class="price_a" style="color: white;"><a href="/cart/findAllCart">去结算</a></div>
                        </div>

                    </div>
                </div>
                <!-- search -->
                <script type="text/javascript">
                    $(function(){
                        //购物车总价
                        var array = $(".cost");
                        var totalCost = 0;
                        for(var i = 0;i < array.length;i++){
                            var val = parseInt($(".cost").eq(i).html());
                            totalCost += val;
                        }
                        $("#totalCost").html(totalCost);
                    });
                </script>
                <div class="clear"></div>
            </div>

        </article>
    </header>
</div>

<div th:fragment="header2">
    <script th:inline="javascript">
        var basePath = "/wood";
    </script>
    <!--头 -->
    <header>
        <article>
            <div class="mt-logo">
                <!--顶部导航条 -->
                <div class="am-container header" style="background-color: #e0efff;">
                    <ul class="message-l">
                        <div class="topMessage">
                            <div class="menu-hd">
                                <span class="fl" th:if="${session.User == null}"><a th:href="@{/login}" target="_top" class="h">亲，请登录</a>&nbsp;<a th:href="@{/register}" style="color:#ff4e00;">免费注册</a>&nbsp;&nbsp;</span>
                                <span class="fl" th:if="${session.User != null}"><a th:href="@{/user/information}" >欢迎回来，<span th:text="${session.User.username}"></span></a>&nbsp;|&nbsp;<a th:href="@{/order/orderList}">我的订单</a>&nbsp;</span>
                                <span class="fl" th:if="${session.User != null}">|&nbsp;<a th:href="@{/user/logout}">注销</a></span>
                            </div>
                        </div>
                    </ul>
                    <ul class="message-r">
                        <div class="topMessage home">
                            <div class="menu-hd"><a th:href="@{/home}" target="_top" class="h">商城首页</a></div>
                        </div>
                        <div class="topMessage my-shangcheng">
                            <div class="menu-hd MyShangcheng"><a th:href="@{/user/information}" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a>
                            </div>
                        </div>


                    </ul>
                </div>


                <div class="top">
                    <div class="logo">
                        <a th:href="@{/home}"><img th:src="@{/images/居家乐.jpg}" style="width: 100px;"></a>
                    </div>
                    <div class="search">
                        <form th:action="@{/product/search}" method="post">
                            <input type="text" name="searchInput" class="s_ipt">
                            <input type="submit" value="搜索" class="s_btn">
                        </form>
                    </div>

                </div>

                <div class="clear"></div>
            </div>

        </article>
    </header>
</div>


<div th:fragment="category">
    <!-- 商品类目 -->
    <div class="nav-table">
        <div class="long-title"><span class="all-goods">全部分类</span></div>
        <div class="nav-cont">
            <ul>
                <li class="index"><a href="/wood/home" style="display: inline">首页</a></li>
                <li class="qc"><a href="/wood/product/search?searchInput=床" style="display: inline">床</a></li>
                <li class="qc"><a href="/wood/product/search?searchInput=沙发" style="display: inline">沙发</a></li>
                <li class="qc"><a href="/wood/product/search?searchInput=柜子" style="display: inline">柜子</a></li>
                <li class="qc"><a href="/wood/product/search?searchInput=桌几" style="display: inline">桌几</a></li>
                <li class="qc"><a href="/wood/product/search?searchInput=窗帘" style="display: inline">窗帘</a></li>
                <li class="qc"><a href="/wood/product/search?searchInput=壁纸" style="display: inline">壁纸</a></li>
                <li class="qc"><a href="/wood/product/search?searchInput=灯饰" style="display: inline">灯饰</a></li>
            </ul>
        </div>
    </div>
    <b class="line"></b>
</div>


<div class="center">
    <div class="col-main">
        <div class="main-wrap">

            <!--            中间-->

        </div>
        <div th:fragment="footer">
            <!--底部-->
            <div class="footer">
                <div class="footer-hd">
                    <p>
                        <a href="# ">商城首页</a>
                        <b>|</b>
                        <a href="# ">物流</a>
                        <b>|</b>
                        <span th:if="${session.User != null}"><span th:if="${session.User.role eq 0}"><a th:href="@{/admin/index}">后台管理</a></span> </span>
                    </p>
                </div>
                <div class="footer-bd">
                    <p>
                        <a href="# ">关于我们</a>
                        <a href="# ">合作伙伴</a>
                        <a href="# ">联系我们</a>
                        <a href="# ">网站地图</a>
                        <em>© 2020-2021 1569926710.com 版权所有</em>
                    </p>
                </div>
            </div>
        </div>
    </div>

    <!--    左侧边栏-->
    <div th:fragment="menu">

        <aside class="menu">
            <ul>
                <li class="person active">
                    <a><i class="am-icon-user"></i>个人中心</a>
                </li>
                <li class="person">
                    <p><i class="am-icon-newspaper-o"></i>个人资料</p>
                    <ul>
                        <li><a th:href="@{/user/information}">个人信息</a></li>
                        <li><a th:href="@{/user/index}">安全设置</a></li>
                        <li><a th:href="@{/user/address}">地址管理</a></li>
                    </ul>
                </li>
                <li class="person">
                    <p><i class="am-icon-balance-scale"></i>我的交易</p>
                    <ul>
                        <li><a th:href="@{/order/orderList}">订单管理</a></li>
                        <li><a th:href="@{/product/change}">退款售后</a></li>
                        <li><a th:href="@{/product/comment}">评价商品</a></li>
                    </ul>
                </li>


                <li class="person">
                    <p><i class="am-icon-tags"></i>我的收藏</p>
                    <ul>
                        <li><a th:href="@{/collection}">收藏</a></li>
                        <li><a th:href="@{/foot}">足迹</a></li>
                    </ul>
                </li>

                <li class="person">
                    <p><i class="am-icon-qq"></i>在线客服</p>
                    <ul>
                        <li><a th:href="@{/product/consultation}">商品咨询</a></li>
                        <li><a th:href="@{/product/suggest}">意见反馈</a></li>

                        <li><a th:href="@{/news}">我的消息</a></li>
                    </ul>
                </li>
            </ul>

        </aside>
    </div>

</div>


</html>